#define DEBUG
#include <cstdio>

using namespace std;

typedef long double ld;

const int maxn=100001;

void add(int n, ld a[], ld b[]) {
  for (int i=1; i<=n; i++) {
    b[i] = b[i-1]+a[i];
  }
}

int main() {
  freopen("exams.in", "r", stdin);
  freopen("exams.out", "w", stdout);

  static int l[maxn+1], r[maxn+1];
  static ld dif[maxn+1], p[3][maxn+1];
  int n;
  scanf("%d", &n);
  for (int i=1; i<=n; i++) {
    scanf("%d %d", l+i, r+i);
    ld t=(ld)1/(r[i]-l[i]);
    dif[l[i]+1] += t, dif[r[i]+1] -= t;
  }

  add(maxn, dif, p[0]);
  add(maxn, p[0], p[1]);
  add(maxn, p[1], p[2]);

  for (int i=1; i<=n; i++) {
    ld t=(ld)(r[i]-l[i]-1)/2;
    printf("%.8LF\n", n-(p[2][r[i]-1]-p[2][l[i]-1]-t+(p[1][r[i]]-p[1][l[i]]-1)/2)/(r[i]-l[i]));
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
